# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pintool
pkgver=24.d538a79
pkgrel=3
pkgdesc='This tool can be useful for solving some reversing challenges in CTFs events.'
groups=('blackarch' 'blackarch-reversing' 'blackarch-binary')
arch=('any')
url='https://github.com/wagiro/pintool'
license=('MIT')
depends=('python2')
makedepends=('git')
source=("git+https://github.com/wagiro/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|env/python|env python2|' "$pkgname.py"
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/" baleful reverse400 wyvern
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

